home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Calc / MicroCalc.jar / Intro.class (.txt) < prev    next >
Encoding:
Java Class File  |  2001-09-07  |  2.4 KB  |  56 lines

  1. import javax.microedition.lcdui.Command;
  2. import javax.microedition.lcdui.CommandListener;
  3. import javax.microedition.lcdui.Displayable;
  4. import javax.microedition.lcdui.Form;
  5. import javax.microedition.lcdui.Image;
  6. import javax.microedition.lcdui.ImageItem;
  7.  
  8. public class Intro extends Form implements CommandListener {
  9.    MicroCalc midlet;
  10.    private Image img;
  11.    private CalcCanvas calcCanvas;
  12.    private long startTime;
  13.    boolean endLoop = false;
  14.    Command exitCommand = new Command(Resources.getText(5), 7, 4);
  15.    Command startCommand = new Command(Resources.getText(6), 1, 1);
  16.    long timer;
  17.    Intro$ForwardThread thread;
  18.  
  19.    public Intro(MicroCalc var1) {
  20.       super(Resources.getText(0));
  21.       this.midlet = var1;
  22.       this.img = this.getImage("img/MicroCalc.png");
  23.       this.calcCanvas = new CalcCanvas(this.midlet, this);
  24.       ((Form)this).append(new ImageItem("SL45i/6688i", this.img, 3, (String)null));
  25.       ((Displayable)this).addCommand(this.startCommand);
  26.       ((Displayable)this).addCommand(this.exitCommand);
  27.       ((Displayable)this).setCommandListener(this);
  28.       this.timer = System.currentTimeMillis();
  29.       this.thread = new Intro$ForwardThread(this);
  30.       this.thread.suspendFlag = false;
  31.       this.thread.start();
  32.    }
  33.  
  34.    static CalcCanvas access$0(Intro var0) {
  35.       return var0.calcCanvas;
  36.    }
  37.  
  38.    public void commandAction(Command var1, Displayable var2) {
  39.       if (var1 == this.exitCommand) {
  40.          this.midlet.destroyApp(false);
  41.       } else if (var1 == this.startCommand) {
  42.          this.endLoop = true;
  43.          this.midlet.display.setCurrent(this.calcCanvas);
  44.       }
  45.  
  46.    }
  47.  
  48.    private Image getImage(String var1) {
  49.       try {
  50.          return Image.createImage("/" + var1);
  51.       } catch (Exception var2) {
  52.          return null;
  53.       }
  54.    }
  55. }
  56.